-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PS bid adapter update to copy site object from config #5083
Conversation
… prebid configuration. If exists, this will be copied over into the request and publisher/page will either be created properties or will overwrite existing config defined values. This will allow other OpenRTB fields within the site object to be passed to Prebid Server, i.e. site.content
@mmoschovas Please check the lint errors in the circleci test report link and fix them. |
} | ||
request.site = (typeof config.getConfig('site') === 'object') ? config.getConfig('site') : {}; | ||
request.site.publisher = { id: _s2sConfig.accountId }, | ||
request.site.page = pageUrl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So if someone sets site
in setConfig, we want to use it.
But we want to overwrite publisher
and page
no matter what?
Here is what the publisher object specifies in openRTB protocol:
So if we did:
pbjs.setConfig({
site: {
...
publisher: {
id: 'some id'
domain: 'prebid.org'
...
}
});
Then we would basically not include the other keys in the user defined publisher object.
Maybe it makes more sense to use utils.deepSet
in order to set the id
of publisher, so that if publisher
already exists we do not overwrite the entire thing but just the id
key?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a test for this as well
… as opposed to overwritting entire publisher object
Changed pull request text formatting to better match Prebid.js pull request conventions. |
LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice Looks good!
* commit '8db2720d60a6533dee52e96f847854ef1c219345': (249 commits) Release 3.17.0 LunaMedia Adapter (prebid#5110) UserId module to export user ids as eids with pbjs.getUserIdsAsEids() (prebid#5108) Triplelift: expose tl_souce in bid response (prebid#5139) Add warning messages for publishers while native ads send assets containing url without sendId (prebid#5096) use customSlotMatching func for reseting targeting (prebid#5132) Teads fix production GDPR error (prebid#5122) No bid version 1.2.5 (prebid#5137) SublimeBidAdapter src/url.js import fix (prebid#5150) Improve Digital adapter: add support for outstream video (prebid#5129) Disallowing remote requests from Safari and Firefox due to browsers no longer supporting DigiTrust ID. (prebid#5109) PS bid adapter update to copy site object from config (prebid#5083) SublimeBidAdapter: Update to version 0.5.1 (prebid#4977) LuponMedia Bid Adapter (prebid#5146) [BUGFIX] AdagioBidAdapter getDataFromLocalStorage (prebid#5081) Revert "New LuponMedia Bid Adapter (prebid#5120)" (prebid#5145) New LuponMedia Bid Adapter (prebid#5120) Feature/send publisher domain (prebid#5121) update test adunit params (prebid#5135) add parameter to the conversant adapter to override the url (prebid#5133) ...
* Updated Prebid Server bid adapter to check for the site object in the prebid configuration. If exists, this will be copied over into the request and publisher/page will either be created properties or will overwrite existing config defined values. This will allow other OpenRTB fields within the site object to be passed to Prebid Server, i.e. site.content * Update to fix lint error and set site.publisher.id using deepSet util as opposed to overwritting entire publisher object * Updated prebid bid adapter spec to include test for site object update Co-authored-by: Michael Moschovas <[email protected]>
Type of change
Description of change
Updated Prebid Server bid adapter to check for the site object in the prebid configuration. If exists, this will be copied over into the request and publisher/page will either be created properties or will overwrite existing config defined values. This will allow other OpenRTB fields within the site object to be passed to Prebid Server, i.e. site.content
Other information
#3783